home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex61.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  582 b   |  29 lines

  1. Program Example61;
  2.  
  3. { Program to demonstrate the SetTextBuf function. }
  4.  
  5. Var
  6.   Fin,Fout : Text;
  7.   Ch : Char;
  8.   Bufin,Bufout : Array[1..10000] of byte;
  9.   
  10. begin
  11.   Assign (Fin,paramstr(1));
  12.   Reset (Fin);
  13.   Assign (Fout,paramstr(2));
  14.   Rewrite (Fout);
  15.   { This is harmless before IO has begun }
  16.   { Try this program again on a big file,
  17.     after commenting out the following 2 
  18.     lines and recompiling it. }
  19.   SetTextBuf (Fin,Bufin);
  20.   SetTextBuf (Fout,Bufout);
  21.   While not eof(Fin) do
  22.     begin
  23.     Read (Fin,ch);
  24.     write (Fout,ch);
  25.     end;
  26.   Close (Fin);
  27.   Close (Fout);
  28. end.
  29.